/**
 *  @file BaseObject.h
 */
#ifndef _BASEOBJECT_H_
#define _BASEOBJECT_H_

#include "commontypes.h"

namespace cppflib
{


/**
 *  The topmost base class for all C++ class that wish to use the auto release pool.
 *   
 *  Note: All derived classes should follow the single-inherit scheme so as to avoid
 *        strange problem while casting between base class and derived class
 */
class _DLLAPI BaseObject
{
protected:  
   // declare these 2 as protected so as to disallow implicit copying by compiler.
   // redefine them in derived class if necessary
   BaseObject(const BaseObject &)
   { 
   }

   const BaseObject& operator=(const BaseObject&)
   { 
      return *this; 
   }

protected:
   BaseObject(void)
   {
   }

public:
   virtual ~BaseObject(void);
   virtual bool Equals(const BaseObject &obj) const;
   virtual u32_t GetHash(void) const;
   virtual pcwstr_t ToString(void) const;

   bool EqualType(const BaseObject &obj) const;

   void *operator new(sz_t size);
   void operator delete(void *p);
   void *operator new[](sz_t size);
   void operator delete[](void *p);
};


}

#endif
